package net.freebytes.es.demo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.freebytes.es.common.annotation.ESID;
import net.freebytes.es.common.annotation.ESMapping;
import net.freebytes.es.common.annotation.ESMetaData;
import net.freebytes.es.common.enums.DataType;

import java.io.Serializable;
import java.time.LocalDateTime;


@Data
@ApiModel(value = "账户信息")
@ESMetaData(indexName = "account", number_of_shards = 3, number_of_replicas = 1, printLog = true, maxResultWindow = 300000)
public class Account implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @ESID
    private String id;

    @ApiModelProperty(value = "开户人身份证")
    @ESMapping(datatype = DataType.keyword_type, keyword = false)
    private String idCard;

    @ApiModelProperty(value = "交易账号")
    @ESMapping(datatype = DataType.keyword_type, keyword = false)
    private String tradingAccount;

    @ApiModelProperty(value = "创建时间）")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ESMapping(datatype = DataType.date_type, keyword = false, dateFormat = "yyyy-MM-dd HH:mm:ss || epoch_millis || yyyy-MM-dd")
    private LocalDateTime createTime;
}

